-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fitting functionality using Ceres-Solver #189
Open
mmccrackan
wants to merge
14
commits into
master
Choose a base branch
from
ceres_solver_fitting
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mmccrackan
changed the title
Adds fitting functionality using Ceres-Solver
Add fitting functionality using Ceres-Solver
Oct 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch is an attempt at adding fitting functionality to
so3g
using theCeres-Solver
library to support both non-linear least squares and general optimization problems. It is used to duplicate the existing noise-fitting function insotodlib
. The idea of this function is to:The cost function classes and fitting functions have been written in a model-independent manner, so they should be easy to adapt for other data and model types.
Ceres
includes options for bounds/constraints and supports auto differentiation so derivatives and gradients don't need be calculated manually. The general minimization routine forCeres
doesn't seem to have uncertainty calculations (its least-squares routines do) so I have manually calculated the inverted Hessian matrix to get the parameter uncertainties.I put most of the code into new
fitting_ops.cxx
andfitting_ops.h
files instead of putting it all inarray_ops.cxx
. I added anarray_ops.h
file to hold shared functions declarations.I've added a cmake directory with cmake files for
Ceres,
Eigen
,Gflag
, andGlog
with the last 3 being dependencies ofCeres-Solver
. We could move these intospt3g
at some point, but this also seems to work in my tests.Eigen
is a nice optimized vector, matrix, and linear algebra library that might be useful on its own, but it is not required to useEigen
when working withCeres
.Building the Docker image for tests will take a few minutes longer now as I found that Ceres needed to be built from source as the necessary version doesn't appear to be available through
apt-get libceres-dev
.